package com.ambition.mallchat.common.user.service;

import com.ambition.mallchat.common.user.domain.entity.User;

/**
 * @program: mallchat-learnning
 * @interfaceName LoginService
 * @description:
 * @author: XXD
 * @create: 2023-10-29 10:45
 * @Version 1.0
 **/
public interface LoginService {
    String login(User user);

    /**
     * 校验token是不是有效
     *
     * @param token
     * @return
     */
    boolean verify(String token);

    /**
     * 刷新token有效期
     *
     * @param token
     */
    void renewalTokenIfNecessary(String token);

    /**
     * 登录成功，获取token
     *
     * @param uid
     * @return 返回token
     */
    String login(Long uid);

    /**
     * 如果token有效，返回uid
     *
     * @param token
     * @return
     */
    Long getValidUid(String token);
}